// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import Vuex from 'vuex';
Vue.use(Vuex)

import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

import {
	navTo,
	redirectTo,
	reLaunchTo,
	showToast,
	store,
	textEllipsis,
	timestampToTime,
	isEmpty,
	formatRichText,
	statusBarHeight,
	screenHeight,
	screenWidth,
	accountFormat,
	getSignText,
	getMangheType,
	getImgUrl
} from './utils/app'
import {
	get,
	post
} from "./utils/request.js";

Vue.config.productionTip = false

import initModal from "@/components/zhangxu-showModal/initModal.js";
import showModal from '@/components/zhangxu-showModal/show-modal';
initModal(Vue);
Vue.component('show-modal', showModal);

App.mpType = 'app'


// 挂载全局函数
Vue.prototype.$toast = showToast
Vue.prototype.$navTo = navTo
Vue.prototype.$redirectTo = redirectTo
Vue.prototype.$reLaunchTo = reLaunchTo
Vue.prototype.$store = store
Vue.prototype.$get = get
Vue.prototype.$post = post
Vue.prototype.$textEllipsis = textEllipsis
Vue.prototype.$timestampToTime = timestampToTime
Vue.prototype.$isEmpty = isEmpty
Vue.prototype.$formatRichText = formatRichText
Vue.prototype.$statusBarHeight = statusBarHeight
Vue.prototype.$screenHeight = screenHeight
Vue.prototype.$screenWidth = screenWidth
Vue.prototype.$accountFormat = accountFormat
Vue.prototype.$getSignText = getSignText
Vue.prototype.$getMangheType = getMangheType
Vue.prototype.$getImgUrl = getImgUrl


Vue.prototype.ScanAudio = function() {
	var music = null;
	music = uni.createInnerAudioContext(); //创建播放器对象
	music.src = "http://wdmanghemp3.oss-cn-hangzhou.aliyuncs.com/open.mp3";
	music.play(); //执行播放
	console.log('播放成功')
	music.onEnded(() => {
		//播放结束
		music = null;
	});
}


const vxStore = new Vuex.Store();

const app = new Vue({
	vxStore,
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
